﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zj.OpenAuth.DTO.Common;

namespace Zj.OpenAuth.App.RoleApp
{
    /// <summary>
    /// role  application service interface 
    /// </summary>
    public interface IRoleAppService
    {
        /// <summary>
        /// get by id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        RoleDTO Get(int id);



        /// <summary>
        /// get all list
        /// </summary>
        /// <returns></returns>
        List<RoleDTO> GetAllList();



        /// <summary>
        /// get children by parent
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        List<RoleDTO> GetAllPageList(int pageIndex, out int rowCount, int pageSize = 10);



        /// <summary>
        /// add  or eidt Role
        /// </summary>
        /// <returns></returns>
        bool AddOrEdit(RoleDTO dto);



        /// <summary>
        /// get menus by role
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        List<int> GetAllMenuListByRole(int value);



        /// <summary>
        /// Get roles by user
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        List<int>  GetAllRoleListByUser(int value);



        /// <summary>
        /// delete by id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        void Delete(int id);



        /// <summary>
        /// delete ids
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        void DeleteMuti(List<int> ids);



        /// <summary>
        /// update role menu mapping
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="roleMenus"></param>
        /// <returns></returns>
        bool UpdateRoleMenu(int roleId, List<RoleMenuMappingDTO> roleMenus);
    }
}
